<?php
$directory = new DirectoryIterator($_GET['folder']);
$result = "";
foreach ($directory as $fileinfo) {
	if ($fileinfo -> isFile()) {
		$result .= $fileinfo -> getFilename() . " ";
	}
}

echo $result;
?>